//
//  TestConnectionTask.m
//  iphone.mobileoa
//
//  Created by 李亚春 on 13-5-31.
//  Copyright (c) 2013年 Epoint. All rights reserved.
//

#import "TestConnectionTask.h"
#import "WebServiceHelper.h"
#import "StringUtil.h"
#import "EPXMLService.h"
#import "UITool.h"

@implementation TestConnectionTask

-(void)execute
{
    NSString *ValidateData = [self.params objectForKey:@"ValidateData"];
    NSString *testurl = [self.params objectForKey:@"testurl"];
    NSString *wsNamespace = [self.params objectForKey:@"namespace"];
    
    WebServiceHelper *webserviceHelper = [[WebServiceHelper alloc]initWebServiceWithUrl:testurl wsNamespace:wsNamespace method:@"ValidateConnection"];
    
     [webserviceHelper addParameterForString:@"ValidateData" value:ValidateData];
    
    NSString *bs = webserviceHelper.start;
    
    if ([EPXMLService validateXML_NOToast:bs]) {
        [UITool toast_mul:@"连接成功"];
    }
    else
    {
     [UITool toast_mul:@"连接失败"];
    }
    
    [self sendDataRefreshUI:@""];
}

@end
